fix(code-review): retry broken sandboxes#3110
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (7 files, incremental)
Changes in this incrementThe PR now moves sandbox-500 retry responsibility into the Durable Object (
Resolved Findings (from prior rounds)
Reviewed by claude-sonnet-4.6 · 8,315,607 tokens |
# Conflicts: # packages/db/src/migrations/meta/0123_snapshot.json # packages/db/src/migrations/meta/_journal.json
Contributor
Author
|
Manual test passed. Tested:
Verified:
|
eshurakov
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Sometimes a code review can fail because the machine it is using breaks. When that happens, the review should get one clean second try instead of staying failed.
What changed
Code reviews now remember which sandbox and attempt they are using. When cloud-agent-next confirms a sandbox failed and destroys it, the web app claims affected reviews only once and starts them again in a fresh attempt. Old updates from the first attempt are ignored, so they cannot overwrite the retry. The same pull request check is reused and shows that the review is trying again.
How to test
pnpm drizzle migrate.pnpm test -- "apps/web/src/app/api/internal/code-review-status/[reviewId]/route.test.ts" apps/web/src/app/api/internal/code-review-sandbox-destroyed/route.test.ts apps/web/src/lib/code-reviews/sandbox-retry.test.ts apps/web/src/lib/code-reviews/db/code-reviews.test.ts apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.test.ts apps/web/src/routers/code-reviews-router.test.ts.pnpm --filter kilo-code-review-worker test.pnpm --filter cloud-agent-next test -- sandbox-recovery.test.ts session-prepare.test.ts.pnpm --filter @kilocode/worker-utils test.